<?php
/**
 * Created by PhpStorm.
 * User: zhouke
 * Date: 2019-03-29
 * Time: 15:58
 */

function plan_get($id= 0, $is_no_cache = 0){
    return is_array($id) ? $id : cache_get_table_obj('plan', $id, $is_no_cache);
}
function plan_img($article_id, $limit='', $is_no_cache = 0){
    $img = db_get_list('wx_img', array('article_id' => $article_id, 'tid' => 1, 'is_show' => 1, 'state' => 1), $limit);
    return $img;
}
function plan_update($article, $up_data){
    db_update('plan', $up_data, array('id' => $article['id']));
    plan_get($article['id'], 1);
}
function plan_title($cat, $cid, $xcid){
    $title = $cat[$cid];
    $xact = explode(',', $xcid);
    if ($xact) {
        $title .= '[';
        foreach ($xact as $v) {
            $title .= $cat[$v].'|';
        }
        $title .= rtrim($title, '|');
        $title .= ']';
    }
    return $title;
}